﻿using System;

namespace Objects
{
    class Player
    {
        public Player()
        {
            _balance = 0;
            FistName = string.Empty;
            LastName = string.Empty;
            DateOfBirth = DateTime.Now;
        }
        public Player(string firstName, string lastName, DateTime dateOfBirth, decimal balance)
        {
            _balance = balance;
            FistName = firstName;
            LastName = lastName;
            DateOfBirth = dateOfBirth;
        }
        private decimal _balance;
        public string FistName { get; set; }
        public string LastName { get; set; }
        private DateTime DateOfBirth { get; set; }
        public int Age
        {
            get
            {
                TimeSpan diff = DateTime.Now - DateOfBirth;
                return diff.Days / 365;
            }
        }
        public decimal Balance
        {
            get
            {
                return _balance;
            }
            set
            {
                _balance = value;
            }
        }       
    }
}
